package com.qfmy.web.app.controller.user;

import com.qfmy.common.result.Result;
import com.qfmy.web.app.service.user.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 清风明月
 * @Package com.qfmy.web.app.controller.user
 * @date 2025/9/17
 * @description 地址表
 */
@RestController
@RequestMapping("/app")
public class AddressController {

    /**
     * 注入service
     */
    @Autowired
    private AddressService addressService;

    /**
     * 添加地址
     */
    @RequestMapping("/addAddress")
    public Result addAddress(@RequestParam String address){
        addressService.addAddress(address);
        return Result.ok();
    }

    /**
     * 判断当前用户是否添加了地址
     */
    @RequestMapping("/isAddAddress")
    public Result<Boolean> isAddAddress(){
        return Result.ok(addressService.isAddAddress());
    }

}
